<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body><?php

include_once '../Login/databaseconnection.php';

if(!loggedin())
{
	require_once '../index.php';
}
else
{
 $School_Id=$_POST['School_Id'];
   $Zone=$_POST['Zone'];
  $Division=$_POST['Division'];
$Province=$_POST['Province'];
  $District=$_POST['District'];
  $Census_Number=$_POST['Census_Number'];
   $Name=$_POST['Name'];
   $Status=$_POST['Status'];
 $Type=$_POST['Type'];
   $Grade_Range=$_POST['Grade_Range'];
  $Medium=$_POST['Medium'];
  $Female_Students=$_POST['Female_Students'];
   $Male_Students=$_POST['Male_Students'];
   $Tp_Number=$_POST['Tp_Number'];
 $Fax_Number=$_POST['Fax_Number'];
  $E_Mail=$_POST['E_Mail'];
  $Web_Address=$_POST['Web_Address'];
  $Special_Projects=$_POST['Special_Projects'];
  $S_Pro="";
  for($i=0;$i<count($Special_Projects);$i++)
  {
	 $S_Pro+=$Special_Projects[$i];
  }
 $S_Pro;
   $Address=$_POST['Address'];
 $Account_Number=$_POST['Account_Number'];
  
  if($School_Id!=""&&$Zone!=""&&$Division!=""&&$Province!=""&&$District!=""&&$Census_Number!=""&&$Name!=""&&$Status!=""&&$Type!=""&&$Grade_Range!=""&&$Medium!="")
	{
		
	$sql=mysql_query("INSERT INTO school(School_Id,Zone,Division,Province,District,Census_Number,Name,Status,Type,Grade_Range,Medium,Female_Students,Male_Students,Tp_Number,Fax_Number,E_Mail,Web_Address,Special_Projects,Address,Account_Number)VALUES('$School_Id','$Zone','$Division','$Province','$District','$Census_Number','$Name','$Status','$Type','$Grade_Range','$Medium','$Female_Students','$Male_Students','$Tp_Number','$Fax_Number','$E_Mail','$Web_Address','$S_Pro','$Address','$Account_Number')");
  if($sql)
  {
$_SESSION['error']="This record is successfully registered!";
  }

  if(!$sql)
  {
$_SESSION['error']="Sorry unable to register this record!";
  }

	}
	
if($School_Id==""||$Zone==""||$Division==""||$Province==""||$District==""||$Census_Number==""||$Name==""||$Status!=""&&$Type==""||$Grade_Range==""||$Medium==""||$Female_Students==""||$Male_Students==""||$Tp_Number==""||$Fax_Number==""||$E_Mail==""||$Web_Address==""||$Address==""||$Account_Number=="")
	{
		
		$_SESSION['errorin']="Please fill all!";
	
	}
  
 
  } 
?>
</body>
</html>
